 var xmlHttp;
 function validate(){
          
         
           var username;
          
              try {
          
                        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
                  } catch (e) {
              try {
            
                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                   } catch (e2) {
                 xmlHttp = false;
               }
              }
               if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
                      xmlHttp = new XMLHttpRequest();
               }
 
      username = document.getElementById("userName").value;
      xmlHttp.onreadystatechange = processStateChange;
      xmlHttp.open("GET", '/duojinV1/regist.do?operation=validate&userName='+username, true); 
      xmlHttp.send(null);
    
      }
      
      function processStateChange(){ 
              if (xmlHttp.readyState == 4) { // Complete 
                 if (xmlHttp.status ==200) { // OK response 
                  
                    document.getElementById("validate").innerHTML=xmlHttp.responseText;
                 } else { 
                      alert("Problem: " + xmlHttp.statustext); 
                } 
      } 
} 
      
      